<template>
  <div class="detail-infos">
    <div class="name">{{ detailInfos.houseName }}</div>
    <div class="tags">
      <template v-for="(item, index) in detailInfos.houseTags" :key="index">
        <div class="item" v-if="item.tagText">
          {{ item.tagText.text }}
        </div>
      </template>
    </div>
    <div class="extra comment">
      <div class="left">
        <div class="score">{{ detailInfos.commentBrief.overall }}</div>
        <div class="title">{{ detailInfos.commentBrief.scoreTitle }}</div>
        <div class="brief">"{{ detailInfos.commentBrief.commentBrief }}"</div>
      </div>
      <div class="right">
        <div class="count">
          {{ detailInfos.commentBrief.totalCount }}条评论
          <van-icon name="arrow" />
        </div>
      </div>
    </div>

    <div class="extra position">
      <div class="address">{{ detailInfos.nearByPosition.address }}</div>
      <div class="right">
        地图·周边
        <van-icon name="arrow" />
      </div>
    </div>
  </div>
</template>

<script setup>
  defineProps({
    detailInfos: {
      type: Object,
      default: () => ({})
    }
  })

</script>

<style lang="less" scoped>
  .detail-infos {
    color: #333;
    padding: 16px;
    background-color: #fff;
    font-size: 12px;

    .name {
      font-size: 20px;
      font-weight: 700;
      text-align: justify;
      line-height: 24px;
      overflow: hidden;
      margin-bottom: 6px;
    }

    .tags {
      display: flex;
      margin: 10px 0;

      .item {
        color: #ff9645;
        background-color: rgba(255, 150, 69, 0.15);
        margin: 0 2px;
        padding: 1px 3px;
      }

      .item:first-child {
        color: rgb(247, 210, 148);
        background-color: rgb(54, 52, 52);
      }

      .item:last-child {
        color: rgb(23, 210, 188);
        background-color: rgba(23, 210, 188, .1);
      }
    }

    .extra {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 12px;
      margin: 12px 0;
      border-radius: 5px;
      background-color: #f5f7fa;
    }

    .comment {
      .left {
        display: flex;
        align-items: center;

        .score {
          font-weight: 700;
          font-size: 18px;
        }

        .title {
          font-weight: 700;
          margin: 0 3px;
        }

        .brief {
          color: #666;
        }
      }


      .right {
        .count {
          color: var(--primary-color);
        }
      }
    }

    .position {
      .address {
        font-size: 14px;
        font-weight: 700;
      }

      .right {
        color: var(--primary-color);
      }
    }
  }
</style>